'''
jsonpath
    Xpath
'''
import jsonpath
data={
    "status":0,
    "errorCode":0,
    "errorMsg":None,
    "body":{
        "userId":10001,
        "userName":"测试用户",
        "role":[
            {"admin":{
                "roleID":100,
                "roleMenu":[
                    "create",
                    "memeber"
                ]
            }},
            {"guest":{
                "roleID":101,
                "roleMenu":[
                    "create",
                    "memeber"
                ]
            }}
        ]
    }
}
result=jsonpath.jsonpath(data,"$.body.userName")
print(result)